For my Urban Economics final map project, I decided to delve into the evolving landscape of abortion access in the US. This topic has gained heightened significance in light of the recent overturning of Roe v. Wade, a landmark 1973 Supreme Court decision that had established a constitutional right to abortion. The overturning of this decision by the Supreme Court in 2022 in the case of Dobbs v. Jackson Women's Health Organization has led to a seismic shift in abortion laws across the country, with some states enacting protective laws and others imposing strict bans or severe restrictions.
Abortion laws in the United States vary significantly by state. Before the overturning of Roe v. Wade, some states had restrictive laws including mandatory waiting periods, counseling requirements, and gestational limits, while others maintained more liberal policies. This variation has led to disparities in abortion access, with states having restrictive abortion laws often having fewer abortion providers, longer travel distances to clinics, and more logistical and financial barriers for individuals seeking abortion care.
In this context, I chose to focus on two key variables from the Guttmacher Institute: the percentage of patients traveling out of state for abortion, and the number of abortion providers in each state. These metrics are crucial in understanding the impact of state laws on abortion access. Unfortunately, the extent of the data available to me reaches only up to 2020. However, this dataset still offers a compelling and dynamic visualization of the shifts in abortion access over time. The percentage of patients traveling out of state for abortion is a particularly telling metric, highlighting the fact that individuals who live in states that have stringent laws regarding abortion may have to travel long distances and incur additional costs to access abortion services. It also indicates the pressure on neighboring states with less restrictive laws, which may see an influx of patients from states with more restrictive policies.
For the final map, I created a GIF visualizing the percentage of patients that travel out of state to obtain abortion care from 2011 to 2020. This dynamic representation provides a clear and impactful way to understand the trends in abortion access over time and its variation across different states.
import base64
from IPython.display import HTML
gif_path = '/Users/hanqingye/Desktop/urban_map/output/travel_oos.gif'
with open(gif_path, 'rb') as gif_file:
gif_base64 = base64.b64encode(gif_file.read()).decode('utf-8')
html_str = f'<img src="data:image/gif;base64,{gif_base64}" alt="GIF">'
display(HTML(html_str))
import pandas as pd
import geopandas as gpd
import os
import xarray, rioxarray
import contextily
import seaborn as sns
from pysal.viz import mapclassify as mc
from legendgram import legendgram
import matplotlib.pyplot as plt
import palettable.matplotlib as palmpl
from splot.mapping import vba_choropleth
from shapely.geometry import Polygon
import warnings
warnings.filterwarnings('ignore')
os.chdir('/Users/hanqingye/Desktop/urban_map')
# Providers data
providers = pd.read_csv(os.getcwd()+'/data/no-of-abortion-providers.csv')
providers.head()
| measure_name | datum | state_id | state_name | datum_date | first_year | last_year | footnotes | sources | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | No. of abortion providers | 32 | AL | Alabama | 1/1/78 | 1978.0 | NaN | A provider is a hospital, clinic or physician'... | Abortion Incidence and Access to Services in t... |
| 1 | No. of abortion providers | 23 | AK | Alaska | 1/1/78 | 1978.0 | NaN | A provider is a hospital, clinic or physician'... | Abortion Incidence and Access to Services in t... |
| 2 | No. of abortion providers | 39 | AZ | Arizona | 1/1/78 | 1978.0 | NaN | A provider is a hospital, clinic or physician'... | Abortion Incidence and Access to Services in t... |
| 3 | No. of abortion providers | 12 | AR | Arkansas | 1/1/78 | 1978.0 | NaN | A provider is a hospital, clinic or physician'... | Abortion Incidence and Access to Services in t... |
| 4 | No. of abortion providers | 527 | CA | California | 1/1/78 | 1978.0 | NaN | A provider is a hospital, clinic or physician'... | Abortion Incidence and Access to Services in t... |
# Keep columns needed and change column names
col_names = ['datum', 'state_id', 'state_name', 'datum_date']
providers = providers[col_names]
new_col_names = ['num_providers', 'state_id', 'state_name', 'year']
providers.columns = new_col_names
providers['year'] = pd.to_datetime(providers['year']).dt.year
providers.dtypes
num_providers int64 state_id object state_name object year int32 dtype: object
# Traveling out of state to obtain care data
travel_oos = pd.read_csv(os.getcwd()+'/data/of-residents-obtaining-abortions-who-traveled-out-of-state-for-care.csv')
travel_oos.head()
| measure_name | datum | state_id | state_name | first_year | last_year | footnotes | sources | |
|---|---|---|---|---|---|---|---|---|
| 0 | % of residents obtaining abortions who travele... | 17.0 | AL | Alabama | 2011 | NaN | NaN | 1.\tMaddow-Zimet I and Kost K, Even before Roe... |
| 1 | % of residents obtaining abortions who travele... | 11.0 | AK | Alaska | 2011 | NaN | NaN | 1.\tMaddow-Zimet I and Kost K, Even before Roe... |
| 2 | % of residents obtaining abortions who travele... | 2.0 | AZ | Arizona | 2011 | NaN | NaN | 1.\tMaddow-Zimet I and Kost K, Even before Roe... |
| 3 | % of residents obtaining abortions who travele... | 27.0 | AR | Arkansas | 2011 | NaN | NaN | 1.\tMaddow-Zimet I and Kost K, Even before Roe... |
| 4 | % of residents obtaining abortions who travele... | 0.0 | CA | California | 2011 | NaN | NaN | 1.\tMaddow-Zimet I and Kost K, Even before Roe... |
# Keep columns needed and change column names
col_names = ['datum', 'state_id', 'state_name', 'first_year']
travel_oos = travel_oos[col_names]
new_col_names = ['out_of_state_pct','state_id', 'state_name', 'year']
travel_oos.columns = new_col_names
travel_oos.dtypes
out_of_state_pct float64 state_id object state_name object year int64 dtype: object
# join two dataframes
abortion = pd.merge(providers, travel_oos, on=['state_id', 'state_name', 'year'], how='outer')
abortion.head()
| num_providers | state_id | state_name | year | out_of_state_pct | |
|---|---|---|---|---|---|
| 0 | 32.0 | AL | Alabama | 1978 | NaN |
| 1 | 23.0 | AK | Alaska | 1978 | NaN |
| 2 | 39.0 | AZ | Arizona | 1978 | NaN |
| 3 | 12.0 | AR | Arkansas | 1978 | NaN |
| 4 | 527.0 | CA | California | 1978 | NaN |
Geodata¶
# US states geo data
gdf = gpd.read_file(os.getcwd()+'/data/cb_2018_us_state_500k')
gdf.head()
| STATEFP | STATENS | AFFGEOID | GEOID | STUSPS | NAME | LSAD | ALAND | AWATER | geometry | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 28 | 01779790 | 0400000US28 | 28 | MS | Mississippi | 00 | 121533519481 | 3926919758 | MULTIPOLYGON (((-88.50297 30.21523, -88.49176 ... |
| 1 | 37 | 01027616 | 0400000US37 | 37 | NC | North Carolina | 00 | 125923656064 | 13466071395 | MULTIPOLYGON (((-75.72681 35.93584, -75.71827 ... |
| 2 | 40 | 01102857 | 0400000US40 | 40 | OK | Oklahoma | 00 | 177662925723 | 3374587997 | POLYGON ((-103.00257 36.52659, -103.00219 36.6... |
| 3 | 51 | 01779803 | 0400000US51 | 51 | VA | Virginia | 00 | 102257717110 | 8528531774 | MULTIPOLYGON (((-75.74241 37.80835, -75.74151 ... |
| 4 | 54 | 01779805 | 0400000US54 | 54 | WV | West Virginia | 00 | 62266474513 | 489028543 | POLYGON ((-82.64320 38.16909, -82.64300 38.169... |
gdf.explore()